The sky sphere can contain several pigment layers with the last pigment being at the bottom, i.e. it is evaluated first, and the first pigment being at the top, i.e. it is evaluated last. If upper layers contain filtering and/or transmitting components lower layers will be seen. If not lower layers will be invisible.
The sky sphere is calculated by using the direction vector as the parameter for evaluating the pigment patterns. This leads to results independent from the view point which pretty good models a real sky where the distance to the sky is much larger than the distances between visible objects.
If you want to add a nice color blend to your background you can easily do this by using the following example.
This gives a soft blend from CornflowerBlue at the horizon to MidnightBlue at the zenith. The scale and translate operations are used to map the direction vector values, which lie in the range from <-1, -1, -1> to <1, 1, 1>, onto the range from <0, 0, 0> to <1, 1, 1>. Thus a repetition of the color blend is avoided for parts of the sky below the horizon.
You should note that only one sky sphere can be used in any scene. It also won't work as you might expect if you use camera types like the orthographic or cylindrical camera. The orthographic camera uses parallel rays and thus you'll only see a very small part of the sky sphere (you'll get one color skies in most cases). Reflections in curved surface will work though, e.g. you will clearly see the sky in a mirrored ball.
The "direction" vector determines the direction of the (virtual) light that is responsible for the rainbow. Ideally this is an infinitely far away light source like the sun that emits parallel light rays. The position and size of the rainbow are specified by the "angle" and "width" keywords. To understand how they work you should first know how the rainbow is calculated.
The default rainbow is a 360 degree arc that looks like a circle. This is no problem as long as you have a ground plane that hides the lower, non-visible part of the rainbow. If this isn't the case or if you don't want the full arc to be visible you can use the optional keywords "up", "arc_angle" and "falloff_angle" to specify a smaller arc.
It is possible to use any number of rainbows and to combine them with other atmospheric effects.
The syntax is:
The default is a white ambient light source.
Note some items which were language directives in previous versions of POV- Ray have been moved inside the global_settings statement so that it is more obvious to the user that their effect is global. The old syntax is permitted but generates a warning.
Each item is optional and may appear in and order. If an item is specified more than once, the last setting overrides previous values. Details on each item is given in the following sections.
You may use the global setting adc_bailout keyword followed by float value to specify the point at which a ray's contribution is considered insignificant.
The default value is 1/255, or approximately 0.0039, since a change smaller than that could not be visible in a 24 bit image. Generally this setting is perfectly adequate, and should be left alone. Setting adc_bailout to 0 will disable ADC, relying completely on max_trace_level to set an upper limit on the number of rays spawned.
See "max_trace_level" for details on how ADC and max_trace_level interact.
The syntax is:
The default is a white ambient light source set at rgb<1,1,1>. The actual ambient used is:
See "ambient" for more information.
The assumed_gamma global setting works in conjunction with the Display_Gamma INI setting (see section "Display Hardware Settings" ) to ensure that scene files render the same way across the wide variety of hardware platforms that POV-Ray is used on. The assumed_gamma setting is used in a scene file as follows:
where the assumed_gamma is the correction factor to be applied before the pixels are displayed and/or saved to disk. For scenes created in older versions of POV-Ray, the assumed_gamma will be the same as the Display_Gamma of the system the scene was created on. For PC systems, the most common Display_Gamma is 2.2, while for scenes created on Macintosh systems should use a scene gamma of 1.8. Another gamma value that sometimes occurs in scenes is 1.0.
Scenes that do not have an assumed_gamma global setting will not have any gamma correction performed on them, for compatibility reasons. If you are creating new scenes or rendering old scenes, it is strongly recommended that you put in an appropriate assumed_gamma global setting. For new scenes, you should use an assumed_gamma value of 1.0 as this models how light appears in the real world more realistically.
The following sections explain more thoroughly what gamma is and why it is important.
Most image files generated by POV-Ray store numbers in the range 0 to 255 for each of the red, green, and blue components of a pixel. These numbers represent the intensity of each color component, with 0 being black, and 255 being the brightest color (either 100% red, 100% green, or 100% blue). When an image is displayed, the graphics card converts each color component into a voltage which is sent to the monitor to light up the red, green, and blue phosphors on the screen. The voltage is usually proportional to the value of each color component.
Gamma becomes important when displaying intensities that aren't the maximum or minimum possible values. For example, 127 should represent 50% of the maximum intensity for pixels stored as numbers between 0 and 255. On systems that don't do gamma correction, 127 will be converted to 50% of the maximum voltage, but because of the way the phosphors and the electron guns in a monitor work, this may be only 22% of the maximum color intensity on a monitor with a gamma of 2.2. To display a pixel which is 50% of the maximum intensity on this monitor, we would need a voltage of 73% of the maximum voltage, which translates to storing a pixel value of 186.
The relationship between the input pixel value and the displayed intensity can be approximated by an exponential function (^ means exponentiation):
where obright is the output intensity, and ibright is the input pixel intensity. Both values are in the range 0 to 1 (0% to 100%). Most monitors have a fixed gamma value in the range 1.8 to 2.6. Using the above formula with display_gamma values greater than 1.0 means the output brightness will be less than the input brightness. In order to have the output and input brightness be equal, an overall system gamma of 1.0 is needed. To do this, we need to gamma correct the input brightness in the same manner as above, but with a gamma value of 1.0/ display_gamma before it is sent to the monitor. To correct for a display gamma of 2.2, this pre-monitor gamma correction uses a gamma value of 1.0/2.2, or approximately 0.45.
How the pre-monitor gamma correction is done depends on what hardware and software is being used. On Macintosh systems, the operating system has taken it upon itself to insulate applications from the differences in display hardware. Through a gamma control panel, the user may be able to set the actual monitor gamma, and MacOS will then convert all pixel intensities so that the monitor will appear to have the specified gamma value. On Silicon Graphics machines, the display adapter has built-in gamma correction calibrated to the monitor which gives the desired overall gamma (the default is 1.7). Unfortunately, on PCs and most UNIX systems, it is up to the application to do any gamma correction needed.
The new PNG format files generated by POV 3.0 overcome the problem of too much or not enough gamma correction by storing the image file gamma (which is 1.0/ Display_Gamma) inside the PNG file when it is generated by POV-Ray. When the PNG file is later displayed by a program that has been set up correctly, it uses this gamma value as well as the current display gamma to correct for the potentially different display gamma used when originally creating the image.
Unfortunately, of all the image file formats POV supports, PNG is the only one that has any gamma correction features and is therefore preferred for images that will be displayed on a wide variety of platforms.